import {Injectable} from "@angular/core";
import {API} from "../constants/constants";
import {RequestUtil} from "../util/request-util";
import {MsgResult} from "../models/msg-result";
import {Observable} from "rxjs/Observable";

@Injectable()
export class DataDictionaryService {

  constructor(
    private requestUtil:RequestUtil
  ) {  }

  /**
   * 根据数据字典code编码获取到code的子节点（不包括code节点本身）
   * @returns {Observable<MsgResult>|any}
   */
  getChildDicByCode(code : string ):Observable<MsgResult>{
    let params="&code="+code;
    return this.requestUtil.get(API.getChildDic+params);
  }
}
